package com.neoCalf.neoCommon.enums;

import com.neoCalf.neoCommon.utils.DataTool;
import lombok.Getter;


@Getter
public enum GroupStatusEnum {
    DIS_BAND(0, "解散"),
    NORMAL(1, "正常"),
    SHUT_DOWN(2, "封禁");

    private final Integer type;
    private final String description;

    GroupStatusEnum(Integer type, String description) {
        this.type = type;
        this.description = description;
    }

    public static GroupStatusEnum getGroupStatusEnumByType(Integer type) {
        if (DataTool.isNull(type)) {
            return null;
        }
        for (GroupStatusEnum statusEnum : GroupStatusEnum.values()) {
            if (statusEnum.getType().equals(type)) {
                return statusEnum;
            }
        }
        return null;
    }

    public static boolean isAllowSend(Integer type) {
        if (DataTool.isNull(type)) {
            return false;
        }
        return type.equals(NORMAL.type);
    }
}
